﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// SchoolYear Repository. Good example of CRUD operations.
    ///// </summary>
    public class SchoolYearRepository : ISchoolYearRepository
    {
        private static readonly ISchoolYearDao _schoolYear = DataAccess.SchoolYearDao;
        public List<SchoolYear> GetList()
        {
            return _schoolYear.GetSchoolYear().ToList();
        }

        public SchoolYear Get(string id)
        {
            return _schoolYear.GetSchoolYearByID(id);
        }

        public void Insert(SchoolYear t)
        {
            _schoolYear.InsertSchoolYear(t);
        }

        public void Update(SchoolYear t)
        {
            _schoolYear.UpdateSchoolYear(t);
        }

        public void Delete(SchoolYear t)
        {
            _schoolYear.DeleteSchoolYear(t);
        }

        public List<SchoolYear> GetSchoolYearBySchoolId(int schoolId)
        {
          return  _schoolYear.GetSchoolYearBySchoolId(schoolId);
        }


        public SchoolYear CapNhatNienKhoaHeThong(string schoolYearId, int schoolId)
        {
            return _schoolYear.CapNhatNienKhoaHeThong(schoolYearId, schoolId);
        }
    }
}